package com.uduemc.biso.core.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.uduemc.biso.core.extities.center.AuthorizeModelAction;
import com.uduemc.biso.core.feign.fallback.AuthorizeModelActionFeignFallback;
import com.uduemc.biso.core.utils.RestResult;

@FeignClient(value = "BISO-BASIC-SERVICE", fallback = AuthorizeModelActionFeignFallback.class)
@RequestMapping(value = "/authorize-model-action")
public interface AuthorizeModelActionFeign {

	@PostMapping("/insert")
	public RestResult insert(@RequestBody AuthorizeModelAction authorizeModelAction);

	@PostMapping("/insert-selective")
	public RestResult insertSelective(@RequestBody AuthorizeModelAction authorizeModelAction);

	@PutMapping("/update-by-id")
	public RestResult updateById(@RequestBody AuthorizeModelAction authorizeModelAction);

	@PutMapping("/update-by-id-selective")
	public RestResult updateByIdSelective(@RequestBody AuthorizeModelAction authorizeModelAction);

	@GetMapping("/find-one/{id}")
	public RestResult findOne(@PathVariable("id") Long id);

	@GetMapping(value = { "/find-all" })
	public RestResult findAll();

	/**
	 * 通过 modelId 获取列表数据
	 * 
	 * @param modelId
	 * @return
	 */
	@GetMapping(value = { "/find-by-model-id/{modelId}" })
	public RestResult findByModelId(@PathVariable("modelId") long modelId);

	/**
	 * 通过 id 删除数据
	 * 
	 * @param modelId
	 * @return
	 */
	@GetMapping(value = { "/delete-by-id/{id}" })
	public RestResult deleteById(@PathVariable("id") long id);

}
